import "../tools/ajax.js";
import listTem from "../modules/listTem.js"
import cartTem from "../modules/cartTem.js"
const indexTem = `<h2>这是首页</h2>`;

const routerView = document.querySelector(".router_view");

window.onhashchange = function(){
    render();
}

render();

function render(){
    switch(location.hash){
        case "#/":
            routerView.innerHTML = indexTem;
            break;
        case "#/list":
            routerView.innerHTML = listTem;
            break;
        case "#/cart":
            routerView.innerHTML = cartTem;
            break;
    }
}


